<?php
use yii\helpers\Url;
?>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>铝邦CRM客户管理系统</title>
    <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="bootstrap/css/bootstrap-datetimepicker.min.css"/>
    <link rel="stylesheet" href="css/common.css"/>
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/setting.css"/>
    <script src="js/jquery-1.12.3.min.js"></script>
    <script src="layui/layui.all.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="bootstrap/js/bootstrap-datetimepicker.min.js"></script>
    <script src="bootstrap/js/bootstrap-datetimepicker.zh-CN.js"></script>
    <script src="js/commer.js"></script>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top nav-top-title">
    <!--小屏幕导航按钮和logo-->
    <div class="navbar-header nav-head">
        <a href="#" class="navbar-brand"></a>
        <h4>客户管理系统</h4>
        <p>Client Management System</p>
    </div>
    <!--小屏幕导航按钮和logo-->
    <!--导航-->
    <div class="navbar-collapse collapse ">
        <ul class="nav navbar-nav navbar-right nav-right">
            <li class="search-nav" onclick="searchshow()">
                <a href="#">&nbsp;&nbsp;搜索</a>
            </li>
            <li class="search" value="divm">
                <input type="text" placeholder="请输入搜索内容"/><span></span>
            </li>
            <li>
                <a href="#">&nbsp;&nbsp;提醒</a>
                <span class="warn">1</span>
            </li>
            <li class="user-center">
                <a href="#">
                    <span class="glyphicon glyphicon glyphicon-user"></span>&nbsp;&nbsp;<?=$userName?>
                </a>
                <div class="user-wap">
                    <div class="tri"></div>
                    <div class="per-infor" data-toggle="modal" data-target="#editMassage">个人信息</div>
                    <div class="cg-psd" data-toggle="modal" data-target="#editPassword">修改密码</div>
                </div>
                <span class="caret"></span>
            </li>
            <li>
                <a href="<?=Url::toRoute(['admin/logout'])?>">
                    <span class="glyphicon glyphicon-off"></span>&nbsp;&nbsp;退出
                </a>
            </li>
        </ul>
    </div>
    <script>
        function searchshow(){
            var mDiv=$(".search").attr("value");
            if(mDiv=="divm"){
                $(".search").show();
                $(".search-nav").hide();
                $(".search").attr("value","divm2");
            }else{
                $(".search").hide();
                $(".search-nav").show();
                $(".search").attr("value","divm");
            }

        }
        $(document).bind("click",function(e){
            var target  = $(e.target);    //e.target获取触发事件的元素
            if(target.closest(".search,.search-nav").length == 0){
                $(".search").hide();
                $(".search-nav").show();
                $(".search").attr("value","divm");
            };
            e.stopPropagation();
        })
        $(function () {
            $(".user-center a,.user-center span").click(function(){
                $(".user-wap").toggle();
            })
        })
    </script>
</nav>
<div class="menu-left col-sm-1 pull-left">
    <div class="add-wap">
        <div class="quick-add">+快速新增</div>
        <div class="add-list">
            <ul>
              <?php echo viewGrant('ckallclue2').'123';  if(viewGrant('ckallclue2')){  ?>  <li data-toggle="modal" data-target="#addClues">线&emsp;索</li><?php } ?>
                <li data-toggle="modal" data-target="#addClient">企&emsp;业</li>
                <li data-toggle="modal" data-target="#addContact">联&emsp;系</li>
                <li data-toggle="modal" data-target="#addAgency">代&emsp;理</li>
            </ul>
        </div>
    </div>
    <div class="work-list">
        <ul>
            <li class="workbench work-on"><a href="<?=Url::toRoute(['admin/work-console'])?>" target="myIframe">工&ensp;作&ensp;台</a></li>
            <li class="clues"><a href="<?=Url::toRoute(['clue/index'])?>" target="myIframe">线&emsp;&emsp;索</a></li>
            <li class="client"><a href="<?=Url::toRoute(['enterprises/index'])?>" target="myIframe">企&emsp;&emsp;业</a></li>
            <li class="agency"><a href="<?=Url::toRoute(['agent/index'])?>" target="myIframe">代&emsp;&emsp;理</a></li>
            <li class="contact"><a href="<?=Url::toRoute(['contact-people/index'])?>" target="myIframe">联&emsp;&emsp;系</a></li>
            <li class="bus-oppo"><a href="">商&emsp;&emsp;机</a></li>
            <li class="conc-rece"><a href="">合同+回款</a></li>
            <li class="follow-news"><a href="<?=Url::toRoute(['follow-infos/index'])?>" target="myIframe">跟进记录</a></li>
            <li class="state-center"><a href="">报表中心</a></li>
            <li class="settings"><a href="<?=Url::toRoute(['system/index'])?>">设&emsp;&emsp;置</a></li>
        </ul>
    </div>
</div>
<div class="menu-right col-sm-11 pull-right">
    <iframe src="<?=Url::toRoute(['admin/work-console'])?>" frameborder="0" class="myframe" name="myIframe"></iframe>
</div>
<div class="modal" id="addClues" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">新增线索</h4>
            </div>
            <div class="modal-body">
                <label class="modal-label"><span class="red">*</span>公司名称：</label>
                <input type="text" placeholder="" name="addBarch" class="modal-input"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>公司地址：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--省份--</option>
                    <option value="1">福建</option>
                    <option value="2">广东</option>
                    <option value="3">江西</option>
                </select>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--城市--</option>
                    <option value="1">厦门</option>
                    <option value="2">福州</option>
                </select>
                <input class="modal-input-lg left-input" type="text"/>
                <div class="clear"></div>
                <label class="modal-label">公司类型：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">负责客服：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--角色--</option>
                    <option value="1">福建</option>
                    <option value="2">广东</option>
                    <option value="3">江西</option>
                </select>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--用户--</option>
                    <option value="1">厦门</option>
                    <option value="2">福州</option>
                </select>
                <div class="clear"></div>
                <label class="modal-label">联系人：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">职务：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">电话：</label>
                <input type="text" placeholder="电话/手机必填一个" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">手机：</label>
                <input type="text" placeholder="手机可以填写多个，用；隔开" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">微信号：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">QQ：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">邮箱：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">主营产品：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">产品标准：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--请选择--</option>
                    <option value="1">国标</option>
                    <option value="2">普通</option>
                    <option value="3">国标与普通</option>
                </select>
                <div class="clear"></div>
                <label class="modal-label">线索来源：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--请选择--</option>
                    <option value="1">贴吧</option>
                    <option value="2">推荐</option>
                </select>
                <div class="clear"></div>
                <label class="modal-label-bz">备注：</label>
                <textarea name="" id="" cols="30" rows="10"></textarea>
                <div class="clear"></div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<div class="modal" id="addClient" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">新增/编辑企业</h4>
            </div>
            <div class="modal-body">
                <label class="modal-label"><span class="red">*</span>企业名称：</label>
                <input type="text" placeholder="" name="addBarch" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>企业账号：</label>
                <input type="text" placeholder="" name="addBarch" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>法人：</label>
                <input type="text" placeholder="" name="addBarch" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>负责人：</label>
                <input type="text" placeholder="" name="addBarch" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>公司地址：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--省份--</option>
                    <option value="1">福建</option>
                    <option value="2">广东</option>
                    <option value="3">江西</option>
                </select>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--城市--</option>
                    <option value="1">厦门</option>
                    <option value="2">福州</option>
                </select>
                <input class="modal-input-lg left-input" type="text"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>公司类型：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--请选择--</option>
                    <option value="1">厂家</option>
                    <option value="2">经销商</option>
                </select>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>联系人：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>联系电话：</label>
                <input type="text" placeholder="" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label-lo"><span class="red">*</span>身份证是否为法人/有无授权：</label>
                <select name="" id="" class="modal-select-sm modal-lo">
                    <option value="0">--请选择--</option>
                    <option value="1">否/无</option>
                    <option value="2">否/有授权</option>
                    <option value="3">有/无</option>
                </select>
                <div class="clear"></div>
                <label class="modal-label-lo"><span class="red">*</span>负责人是否和身份证一致：</label>
                <select name="" id="" class="modal-select-sm modal-lo">
                    <option value="0">--请选择--</option>
                    <option value="1">是</option>
                    <option value="2">否</option>
                </select>
                <div class="clear"></div>
                <div class="many-wap">
                    <label class="modal-label">下次跟进时间：</label>
                    <input class="span2 datetimepicker modal-input-lg " size="16" type="text" value="">
                    <div class="clear"></div>
                    <label class="modal-label">负责客服：</label>
                    <select name="" id="" class="modal-select-sm">
                        <option value="0">--角色--</option>
                        <option value="1">财务人员</option>
                        <option value="2">运营人员</option>
                    </select>
                    <select name="" id="" class="modal-select-sm">
                        <option value="0">--用户--</option>
                        <option value="1">思远</option>
                        <option value="2">小曼</option>
                        <option value="3">阿里</option>
                    </select>
                    <div class="clear"></div>
                    <label class="modal-label">申请时间：</label>
                    <input class="span2 datetimepicker modal-input-lg start" size="16" type="text" value="">
                    <div class="clear"></div>
                    <label class="modal-label">通过时间：</label>
                    <input class="span2 datetimepicker modal-input-lg end" size="16" type="text" value="">
                    <div class="clear"></div>
                    <label class="modal-label">推荐人：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">推荐人手机：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">注册资金(万元)：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">电话：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">传真：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">邮箱：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">企业网站：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">主营产品：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">产品标准：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">产能/库存(吨)：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">月销售量(吨)：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">加工情况：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">主营地区：</label>
                    <input type="text" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label-bz">备&emsp;&emsp;注：</label>
                    <textarea name="" id="" cols="30" rows="10"></textarea>
                    <div class="clear"></div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn-default btn many">展开更多信息</button>
                <button type="button" class="btn btn-primary">保存</button>
                <button type="button" class="btn btn-default btn-qx" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<div class="modal" id="addContact" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">新增/编辑联系</h4>
            </div>
            <div class="modal-body">
                <label class="modal-label"><span class="red">*</span>姓名：</label>
                <input type="text" placeholder="" name="addname" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>所属企业：</label>
                <input class="modal-input-lg" type="text"/>
                <div class="clear"></div>
                <label class="modal-label">联系方式：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">职务：</label>
                <input type="text" placeholder="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">性别：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--请选择--</option>
                    <option value="1">男</option>
                    <option value="2">女</option>
                    <option value="3">其他</option>
                </select>
                <div class="clear"></div>
                <label class="modal-label">微信号：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">QQ：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label-bz">备&emsp;&emsp;注：</label>
                <textarea name="" id="" cols="30" rows="10"></textarea>
                <div class="clear"></div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<div class="modal" id="addAgency" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">新增/编辑代理</h4>
            </div>
            <div class="modal-body">
                <label class="modal-label"><span class="red">*</span>姓名：</label>
                <input type="text" placeholder="" name="addBarch" class="modal-input"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>代理账号：</label>
                <input type="text" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">身份证号：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">所属企业：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>联系方式：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>是否有名片：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--请选择--</option>
                    <option value="1">是</option>
                    <option value="2">否</option>
                    <option value="3">否/有授权函</option>
                </select>
                <div class="clear"></div>
                <label class="modal-label"><span class="red">*</span>所在地区：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--省份--</option>
                    <option value="1">福建</option>
                    <option value="2">广东</option>
                    <option value="3">江西</option>
                </select>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--城市--</option>
                    <option value="1">厦门</option>
                    <option value="2">福州</option>
                </select>
                <div class="clear"></div>
                <label class="modal-label">详细地址：</label>
                <input type="text" placeholder="" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">负责客服：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--角色--</option>
                    <option value="1">运营人员</option>
                    <option value="2">销售人员</option>
                    <option value="3">其他</option>
                </select>
                <select name="" id="" class="modal-select-sm">
                <option value="0">--用户--</option>
                <option value="1">22</option>
                <option value="2">33</option>
                <option value="3">2233</option>
            </select>
                <div class="clear"></div>
                <label class="modal-label">推荐人：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">推荐人手机：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">职务：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">性别：</label>
                <select name="" id="" class="modal-select-sm">
                    <option value="0">--请选择--</option>
                    <option value="1">男</option>
                    <option value="2">女</option>
                    <option value="3">其他</option>
                </select>
                <div class="clear"></div>
                <label class="modal-label">微信号：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label">QQ：</label>
                <input type="text" name="" class="modal-input-lg"/>
                <div class="clear"></div>
                <label class="modal-label-bz">备&emsp;&emsp;注：</label>
                <textarea name="" id="" cols="30" rows="10"></textarea>
                <div class="clear"></div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--个人信息-->
<div class="modal" id="editMassage" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">修改个人信息</h4>
            </div>
            <div class="modal-body">
                <form id="infoForm" action="" method="post">
                    <label class="modal-label">员工姓名：</label>
                    <span><?=$userName?></span>
                    <div class="clear"></div>
                    <label class="modal-label">所属部门：</label>
                    <span><?=$departments['departName']?></span>
                    <div class="clear"></div>
                    <label class="modal-label">角色：</label>
                    <span><?=$roles['roleName']?></span>
                    <div class="clear"></div>
                    <label class="modal-label">手机号码：</label>
                    <input type="text" name="cellPhone" value="<?=$cellPhone?>" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">邮箱：</label>
                    <input type="text" name="email" value="<?=$email?>" class="modal-input-lg"/>
                    <div class="clear"></div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary btn-editMassage" onclick="saveInfo();">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!--修改密码-->
<div class="modal" id="editPassword" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                <h4 class="modal-title add-title">修改密码</h4>
            </div>
            <div class="modal-body">
                <form id="saveForm" action="" method="post">
                    <label class="modal-label">旧密码：</label>
                    <input type="password" name="oldPwd" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">新密码：</label>
                    <input type="password" name="newPwd" placeholder="6-15个字符,区分大小写,仅限数字和字母" class="modal-input-lg"/>
                    <div class="clear"></div>
                    <label class="modal-label">确认密码：</label>
                    <input type="password" name="confirmPwd" placeholder="两次密码要输入一致" class="modal-input-lg"/>
                    <div class="clear"></div>
                </form>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary btn-editPassword" onclick="savePassword()">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
        $(".work-list ul li").click(function () {
            var index = $(this).index();
            if(index == 5 || index == 6 || index == 8){
                alert("暂时未开通此服务~~~");
            }else{
                $(this).siblings().removeClass("work-on");
                $(this).addClass("work-on");
            }
        });
        $(".quick-add").click(function(){
            $(".add-list").toggle(600);
        });
        $(".many").click(function () {
            $(".many-wap").css("display","block");
            $(this).css("display","none");
        });
        $(".btn-qx").click(function () {
            $(".many-wap").css("display","none");
            $(".many").css("display","inline-block");
        });
        //模态框
        $("#addClues").modal({
            keyboard:false,
            show:false
        });
        $("#addClient").modal({
            keyboard:false,
            show:false
        });
        $("#addContact").modal({
            keyboard:false,
            show:false
        });
        $("#addAgency").modal({
            keyboard:false,
            show:false
        });

//        修改个人信息
       /* $(".per-infor").click(function () {
            var url = '';
            $.get(url, function () {
                success:{
                    layer.msg("返回数据");
                    $("#editMassage").modal({
                        keyboard:false,
                        show:false
                    });
                }
            })
        })*/
//        修改密码
      /*  $(".cg-psd").click(function () {
            var url = "";
            $.get(url, function () {
                success:{
                    layer.msg("请求成功");
                    $("#editPassword").modal({
                        keyboard:false,
                        show:false
                    })
                }
            })
        });*/
        //时间选择
        $(".span2").datetimepicker({
            language:'zh-CN',//中文显示日期
            format:'yyyy-mm-dd hh:ii',//显示为年：月：日 时：分
            weekStart:1,//星期一为一周开始
            todayBtn:true,//可以选择当前时间
            autoclose:true,//自动关闭
            todayHighlight:true,//今天高亮
            startView:2,
            forceParse:true,  //输入错误的时间时，会强制解析
            showMeridian:true, //启用子午线视图？不知道什么鬼
            minuteStep:5    //最小分钟数，设置为5
        });
        $(".start").datetimepicker().on("click",function(){
            $(this).datetimepicker("setEndDate",$(".end").val())
        });
        $(".end").datetimepicker().on("click",function(){
            $(this).datetimepicker("setStartDate",$(".start").val())
        });

//        修改个人信息
       /* $(".btn-editMassage").click(function () {
            var url = '';
            var date = $(this).parents("#editMassage").find("form").serialize();
            $.post(url,date, function () {
                error:{
                    layer.msg("修改成功~");
                }
            })
        });*/
//        修改密码
        $(".btn-editPassword").click(function () {

        })
        /**
         * 提交修改密码
         */

    })
    function savePassword(){
        var url="<?=Url::toRoute(['admin/edit-user-password'])?>";
        var params =$('#saveForm').serialize();
        $.post(url,params, function (data) {
            var data=JSON.parse(data);
            if(data.errcode==0){
                layer.msg(data.errmsg);
                window.location.reload();
            }else{
                layer.msg(data.errmsg);
            }
        })

    }
    function saveInfo(){
        var url="<?=Url::toRoute(['admin/edit-user-info'])?>";
        var params =$('#infoForm').serialize();
        $.post(url,params, function (data) {
            var data=JSON.parse(data);
            if(data.errcode==0){
                layer.msg(data.errmsg);
                window.location.reload();
            }else{
                layer.msg(data.errmsg);
            }
        })
    }
</script>
</body>
</html>